<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>鼠标移动视差玻璃态效果</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <section>
    <div class="img_box">
      <p class="text">Parallax</p>
    </div>
    <div class="box box1"></div>
    <div class="box box2">
      <p class="text">Parallax</p>
    </div>
  </section>
</body>
<script>
  const pos = document.documentElement
  pos.addEventListener('mousemove', (e) => {
    pos.style.setProperty('--x', e.clientX + 'px')
    pos.style.setProperty('--y', e.clientY + 'px')
  })
</script>

</html>